//第一个轮播图
let mySwiper = new Swiper('#swiper-1', {
    //基于这些配置，告诉swiper我想要的效果
    initialSlide: 2,
    speed: 300,
    //开启无限循环
    loop: true,
    //开启自动切换
    autoplay: {
        delay: 2000,
        disableOnInteraction: false
    },
    //控制切换效果   水平切换
    effect: 'fade',
    // 开启分页器
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
        type: "custom",
       currentClass: 'my-pagination-current',//分式类型分页器的当前索引的类名
        renderCustom: function (swiper, current, total) {
            var customPaginationHtml = '<div class="header-list"><ul>';
            var arr=[
            "蝶影：魏大勋冯越演绎热血特工",
            "黄金大劫案：杜淳马苏热血救国",
            "守护丽人：张译变身胡同暖男",
            "中国乒乓：邓超绝地反击",
            "东海客栈：敌后武工队锄奸杀寇",
            "忍者神龟：神龟集结共抗强敌",
            "绝杀：丁勇岱粉碎日寇核计划",
            "北京傲客：北漂青年故事",
            "生死翻盘：吴其江踏上特工之路",
            "花开半夏：李沁林雨申为爱痴狂"
            ]
            for (var i = 0; i < total; i++) {
                //判断哪个分页器此刻应该被激活
                if (i == current - 1) {
                    customPaginationHtml +=
                        `<li style=" background-color: #E42112;" >${arr[i]}</li>`;
                } else if (i == 0) {
                    customPaginationHtml += '<li class="ss" >蝶影：魏大勋冯越演绎热血特工</li>';
                } else if (i == 1) {
                    customPaginationHtml += '<li class="ss">黄金大劫案：杜淳马苏热血救国</li>';
                } else if (i == 2) {
                    customPaginationHtml += ' <li class="ss">守护丽人：张译变身胡同暖男</li>';
                } else if (i == 3) {
                    customPaginationHtml += ' <li class="ss">中国乒乓：邓超绝地反击</li>';
                } else if (i == 4) {
                    customPaginationHtml += '<li class="ss">东海客栈：敌后武工队锄奸杀寇</li>';
                } else if (i == 5) {
                    customPaginationHtml += '<li class="ss">忍者神龟：神龟集结共抗强敌</li>';
                } else if (i == 6) {
                    customPaginationHtml += ' <li class="ss">绝杀：丁勇岱粉碎日寇核计划</li>';
                } else if (i == 7) {
                    customPaginationHtml += ' <li class="ss">北京傲客：北漂青年故事</li>';
                } else if (i == 8) {
                    customPaginationHtml += '<li class="ss">生死翻盘：吴其江踏上特工之路</li>';
                } else if (i == 9) {
                    customPaginationHtml += ' <li class="ss">花开半夏：李沁林雨申为爱痴狂</li>';
                } else if (i == 10) {
                    customPaginationHtml += ' <li class="ss">花开半夏：李沁林雨申为爱痴狂</li>';
                }
            }
            customPaginationHtml += " </ul> </div>"
            return customPaginationHtml;
        }
    },
    //开启导航按钮
    // navigation: {
    //     nextEl: '.swiper-button-next',
    //     prevEl: '.swiper-button-prev',
    // },
});

$(".swiper-pagination").on("mousemove", "li", function () {
    var index = $(this).index();
    //mySwiper.slideTo(index);
    mySwiper.slideToLoop(index);
});